/**
 * Copyright 2023 Inc.
 **/
package com.myz.springboot.alibaba.nacos.controller;

import com.alibaba.nacos.api.config.annotation.NacosValue;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author maoyz0621 on 2023/8/30
 * @version v1.0
 */
@RestController
public class DemoController {

    /**
     * autoRefreshed = true 自动刷新
     */
    @NacosValue(value = "${a}", autoRefreshed = true)
    private String a;

    /**
     * 修改配置，无法更新
     */
    @Value("${b}")
    private String b;

    @RequestMapping("/index")
    public String getA() {
        return a + " | " + b;
    }

}